package com.xbongbong.pro.domain.dao;

import com.xbongbong.pro.domain.entity.LabelEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * @author guohui.zhang
 * @Title:
 * @date 2020/11/218:39
 */
@Repository
@Mapper
public interface LabelDao {
    Integer insert(LabelEntity entity);

    Integer update(LabelEntity entity);

    List<LabelEntity> findEntitys(@Param("param") Map<String, Object> param);

    Integer getEntitysCount(@Param("param") Map<String, Object> param);

    LabelEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

    Integer sort(@Param("param") Map<String, Object> param, @Param("sortMap") Map<Long, Long> sortMap);

    Integer deleteByKey(@Param("key") Long key, @Param("corpid") String corpid);

    void insertBatch(@Param("list")List<LabelEntity> entitys);


    Integer updateBatch(@Param("list") List<LabelEntity> updateConfigList, @Param("corpid") String corpid);

    List<LabelEntity> getByGroupId(@Param("key") Long groupId, @Param("corpid")  String corpid);

    List<LabelEntity> getByName(@Param("key") String name, @Param("formId") Long formId, @Param("corpid") String corpid);

    void deleteBatch(@Param("list") List<Long> labelIds, @Param("corpid") String corpid);

    void deleteByFormIds(@Param("list") Collection<Long> formIds, @Param("corpid") String corpid, @Param("appId") Long appId);
}
